#include<iostream>
using namespace std;
int main(){
  int arr[5][5];
  int i=0,j=0,k=0;
  int x=0;
  int y=0;
  bool find=false;
    for(i=0;i<5;i++){
    for(j=0;j<5;j++)
    cin>>arr[i][j];
  }

  for(k=0;k<5;k++){  
    x=0;
    y=0;
    for(int j=1;j<5;j++)
      if(arr[k][j]>arr[k][x])x=j;
    for(int i=1;i<5;i++)
      if(arr[i][x]<arr[y][x])y=i;
    if(k==y){
      find=true;
      cout<<y+1<<" "<<x+1<<" "<<arr[y][x]<<endl;
    }
  }
  if(!find)
    cout<<"not found";
}
